package multithread;

public class Worker {
	int id;
	public Worker(int id) {
		this.id = id;
	}
	synchronized void doTaskWithCooperator(Worker other) {
		try {
			Thread.sleep(500);
		} catch(Exception e) {
			synchronized(other) {
				System.out.println("doing" + id);
			}
		}
	}

}
